using UnityEngine;

public class DropedEquip : MonoBehaviour
{
	public Transform tf;

	public Transform TF_SPR;

	public SpriteRenderer sr;

	public Rigidbody2D rb;

	private void Start()
	{
		Vector3 vector = GetSpritePivot(sr.sprite);
		TF_SPR.localPosition += vector - new Vector3(0.5f, 0.5f);
		rb.angularVelocity = ((Random.Range(0, 2) != 0) ? (-1000) : 1000);
	}

	public Vector2 GetSpritePivot(Sprite sprite)
	{
		Bounds bounds = sprite.bounds;
		float x = (0f - bounds.center.x) / bounds.extents.x / 2f + 0.5f;
		float y = (0f - bounds.center.y) / bounds.extents.y / 2f + 0.5f;
		return new Vector2(x, y);
	}
}
